package com.example.intercepter;/**
 * @author wangXiao
 */

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Description: 拦截器配置
 * @Author wangXiao
 * @Date 2024/10/16 
 **/
@Configuration
//@EnableWebMvc
public class ConfigMVC implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // 注册自定义拦截器实例，并指定拦截的路径模式
        registry.addInterceptor(new SingleSignOnInterceptor()).addPathPatterns("/**")
                .excludePathPatterns("/login", "/register"); // 可以排除某些路径不被拦截
    }


}
